// 导入vue-router包
import VueRouter from '_vue-router@3.1.3@vue-router/dist/vue-router'

// 导入对应的路由组件
import home from './components/tabbar/home.vue'
import member from './components/tabbar/member.vue'
import shopcar from './components/tabbar/shopcar.vue'
import search from './components/tabbar/search.vue'
import newsList from './components/news/newsList.vue'
import newsinfo from './components/news/newsinfo.vue'
import photolist from './components/photos/photolist.vue'
import photoinfo from './components/photos/photoinfo.vue'
import goodslist from './components/goods/goodslist.vue'
import goodsinfo from './components/goods/goodsinfo.vue'
import goodsdesc from './components/goods/goodsdesc.vue'
import goodscomments from './components/goods/goodscomments.vue'
// 创建路由模块
var router1 = new VueRouter({
  routes: [ //配置路由规则
    { path: '/', redirect: '/home' },
    { path: '/home', component: home, },
    { path: '/member', component: member },
    { path: '/shopcar', component: shopcar },
    { path: '/search', component: search },
    { path: '/home/newsList', component: newsList },
    { path: '/home/newsinfo/:id', component: newsinfo },
    { path: '/home/photolist', component: photolist },
    { path: '/home/photoinfo/:id', component: photoinfo },
    { path: '/home/goodslist', component: goodslist },
    { path: '/home/goodsinfo/:id', component: goodsinfo },
    { path: '/home/goodsdesc/:id', component: goodsdesc, name: 'goodsdesc' },
    { path: '/home/goodscomments/:id', component: goodscomments, name: 'goodscomments' },



  ],
  linkActiveClass: 'mui-active'  //覆盖默认的路由高亮的类,默认的类叫做routerlink-active
})

// 把router1暴露出去
export default router1